package com.hexus.eve.entities;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name="eveIcons")
public class Icon {
	//private final static Integer DEFAULT_ICON_ID = 0;

	/*
	public final static String ICONS_FOLDER = "./img/Icons";
	public final static String ITEMS_FOLDER = "items";
	public final static String ICON_PREFIX = "icon";
	public final static String ICON_POSTFIX = ".png";
	public final static String FOLDER_16x16 = "16_16";
	public final static String FOLDER_32x32 = "32_32";
	public final static String FOLDER_64x64 = "64_64";
	public final static String FOLDER_128x128 = "128_128";
	public final static String FOLDER_256x256 = "256_256";
	*/
	
	@Id
	@Column(name="iconID")
	private Integer id;
	@Column(name="iconFile")
	private String fileName;
	private String description;
	
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getFileName() {
		return fileName;
	}
	public void setFileName(String fileName) {
		this.fileName = fileName;
	}
	/*
	private String getPath(String size_folder) {
		return ICONS_FOLDER + '/' + ITEMS_FOLDER + '/' + size_folder + '/' + ICON_PREFIX + fileName + ICON_POSTFIX;
	}
	
	private Boolean exists(String fileName) {
		File file = new File(fileName); 
		return file.exists();
	}
	
	public String getPath16() {
		return getPath(FOLDER_16x16);
	}
	
	public Boolean getHasSize16() {
		return exists(getPath16());
	}
	
	public String getPath32() {
		return getPath(FOLDER_32x32);
	}
	
	public Boolean getHasSize32() {
		return exists(getPath32());
	}
	
	public String getPath64() {
		return getPath(FOLDER_64x64);
	}
	
	public Boolean getHasSize64() {
		return exists(getPath64());
	}

	public String getPath128() {
		return getPath(FOLDER_128x128);
	}

	public Boolean getHasSize128() {
		return exists(getPath128());
	}
	
	public String getPath256() {
		return getPath(FOLDER_256x256);
	}
	
	public Boolean getHasSize256() {
		return exists(getPath256());
	}
	*/
}
